package com.jiang.demo.user.controller;

import com.jiang.demo.user.domain.Book;
import com.jiang.demo.user.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@CrossOrigin
@RestController
public class BookConeroller {
    @Autowired
    BookService bookService;

    @GetMapping("/api/book/info/")
    public List<Book> info(){
        return bookService.info();
    };
    @PostMapping("/api/book/gettype/")
    public List<Book> gettype(@RequestParam Map<String,String> data){
        return bookService.gettype(data);
    };
    @PostMapping("/api/book/updata/")
    public Map<String,String> updata(@RequestParam  Map<String,String> data){
        return bookService.updata(data);
    };
    @PostMapping("/api/book/add/")
    public Map<String,String> add(@RequestParam Map<String,String> data){
        return bookService.add(data);
    };
    @PostMapping("/api/book/delet/")
    public Map<String,String> delet(@RequestParam Map<String,String> data){
        return bookService.delet(data);
    };
}
